import type { ListResponse } from '@/types/common'
import type { AddRodParams, AreaListItem, RodListItemRes, RodListParams } from '@/types/rod'
import { request } from '@/utils/reuqest'

/**
 * 查看一体杆列表
 */
export const getRodListAPI = (params: RodListParams) => {
  return request<ListResponse<RodListItemRes>>('/pole/info/list', 'GET', params)
}

/**
 * 添加一体杆
 */
export const addRodAPI = (params: AddRodParams) => {
  return request('/pole/info', 'POST', params)
}

/**
 * 获取关联区域下拉列表
 */
export const getAreaListAPI = () => {
  return request<AreaListItem[]>('/parking/area/dropList', 'GET')
}

/**
 * 删除一体杆
 */
export const deleteRodAPI = (id: number | string) => {
  return request(`/pole/info/${id}`, 'DELETE')
}
